// ITI 1120 Fall 2006, Lab 8, Exercise 1 // Name: Diana Inkpen, Student# 123456 /** * A recursive algorithm to test if all the characters in positions 0...N of an * array, S of characters are digits. */ class CheckDigits { public static void main (String[] args) { // DECLARE VARIABLES/DATA DICTIONARY char[] a; // an array of characters int n; // a position in the array. boolean result; // true if positions 0 to n // contain digit characters // PRINT OUT IDENTIFICATION INFORMATION System.out.println(); System.out.println("ITI1120 Fall 2006, Lab 8, Exercise 1"); System.out.println("Name: Diana Inkpen, Student# 123456"); System.out.println(); // READ IN GIVENS System.out.println("Please enter characters, all in one line (no spaces): "); a = ITI1120.readCharLine(); n = a.length; // BODY OF ALGORITHM result = checkDigits(a, n); // PRINT OUT RESULTS AND MODIFIEDS System.out.println("Only digits " + result); } // If the 'main' method calls other algorithms, put the method(s) below. /** * METHOD: * * * GIVENS: */ public static boolean checkDigits( char[] a, int n ) { /* complete the method */ } }